package net.admin.action;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.admin.db.item.CustDAO;

public class CustSearchAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		ActionForward af = new ActionForward();
		af.setRedirect(false);
		af.setPath("/admin/item/cust_search.jsp");
		String cust_nm = request.getParameter("cust_nm");
				
		CustDAO cd = new CustDAO();
		ArrayList resultSet = null;
		try{
			 resultSet= (ArrayList)cd.getCustList(cust_nm);
		}catch(Exception e){
			request.setAttribute("result", "N");
			e.printStackTrace();
		}
		cd.close();
		request.setAttribute("cust_nm", cust_nm);
		request.setAttribute("result","Y");
		request.setAttribute("resultSet", resultSet);
		return af;
	}

}
